<template>
	<view>
		<image src="/static/work1.jpg" mode="" class="img_bg"></image>
		<view class="" style="position: absolute; top: 0; width: 100%;">
		<view class="text-left bg-white padding-l30 margin-l20 margin-r20 padding-r30 margin-t30" style="border-radius: 3%;">
			<view class="text-36 text-bold "style="border-bottom: solid #808080 1upx; text-align: center;">巡检信息</view>
			<view class="border-bottom display justify-between align-center">
				<view class="text-36 padding-t30 padding-b30">巡检点</view>
				<view class="text-32 font-gray1 padding-r30">{{danger_listMenu.danger_name?danger_listMenu.danger_name:'-'}}</view>
			</view>
			<view class="border-bottom display justify-between align-center">
				<view class="text-36 padding-t30 padding-b30 ">巡检时间</view>
				<view class="text-32 font-gray1 padding-r30">{{time?time:'-'}}</view>
			</view>
			<view class="border-bottom display justify-between align-center">
				<view class="text-36 padding-t30 padding-b30">巡检人</view>
				<view class="text-32 font-gray1 padding-r30">{{danger_listMenu.nickname?danger_listMenu.nickname:'-'}}</view>
			</view>
			
			<view class="border-bottom display justify-between align-center">
				<view class="text-36 padding-t30 padding-b30">拍照地址</view>
				<text class="text-32 font-gray1 padding-r30">{{danger_listMenu.pic_location?danger_listMenu.pic_location:'-'}}</text>
			</view>
			
			<view class="border-bottom display justify-between align-center">
				<view class="text-36 padding-t30 padding-b30 ">巡检班次</view>
				<view class="text-32 font-gray1 padding-r30">{{danger_listMenu.inspection_name?danger_listMenu.inspection_name:'-'}}</view>
			</view>
			<view class="border-bottom  justify-between align-center">
				<view class="text-36 padding-t30 padding-b30">巡检现场照片</view>
				<image  :src="phone" class="addImage padding-r10"  v-if="phone!=''" @tap="previewImage1(1)"></image>
				<image src="/static/add.png" class="addImage"v-else></image>
			</view>
			<view class="border-bottom margin-t30">
				<view class="text-36 padding-t30 padding-b30 border-top">巡检内容描述</view>
				<view class="text-32 font-gray1 padding-r30 saytext padding-b30">{{danger_listMenu.remark?danger_listMenu.remark:'暂无巡检备注...'}}</view>
			</view>
		</view>

			<view class="text-left bg-white padding-l30 margin-t30 margin-l20 margin-r20 padding-r30" v-if="zhuangtai==2"  style="border-radius: 3%;">
				<view class="text-36 text-bold "style="border-bottom: solid #808080 1upx; text-align: center;">整改信息</view>
				<view class="border-bottom display justify-between align-center">
					<view class="text-36 padding-t30 padding-b30">指派人</view>
					<view class="text-32 font-gray1 padding-r30">{{danger_listMenu.assign_user?danger_listMenu.assign_user:'-'}}</view>
				</view>
				<view class="border-bottom display justify-between align-center">
					<view class="text-36 padding-t30 padding-b30">整改人</view>
					<view class="text-32 font-gray1 padding-r30">{{danger_listMenu.rectify_user?danger_listMenu.rectify_user:'-'}}</view>
				</view>
				<view class="border-bottom display justify-between align-center">
					<view class="text-36 padding-t30 padding-b30 ">风险分类</view>
					<view class="text-32 font-gray1 padding-r30">{{danger_listMenu.safety_type?danger_listMenu.safety_type:'-'}}</view>
				</view>
				<view class="border-bottom display justify-between align-center">
					<view class="text-36 padding-t30 padding-b30 ">要求完成时间</view>
					<view class="text-32 font-gray1 padding-r30">{{danger_listMenu.rectify_overtime?danger_listMenu.rectify_overtime:'-'}}</view>
				</view>
				<view class="border-bottom display justify-between align-center">
					<view class="text-36 padding-t30 padding-b30 ">整改时间</view>
					<view class="text-32 font-gray1 padding-r30">{{danger_listMenu.rectify_time?danger_listMenu.rectify_time:'-'}}</view>
				</view>
				<view class="border-bottom  justify-between align-center">
					<view class="text-36 padding-t30 padding-b30">整改照片</view>
					<image  :src="phone1" class="addImage padding-r10"  v-if="phone1!=''" @tap="previewImage2(1)"></image>
					<image src="/static/add.png" class="addImage"v-else></image>
				</view>
				<view class="border-bottom margin-t30">
					<view class="text-36 padding-t30 padding-b30 border-top">整改方案描述</view>
					<view class="text-32 font-gray1 padding-r30 saytext padding-b30">{{danger_listMenu.rectify_remarks?danger_listMenu.rectify_remarks:'暂无整改方案...'}}</view>
				</view>
			</view>
			
			<view class="text-left bg-white padding-l30 margin-t30 margin-l20 margin-r20 padding-r30 margin-b20" v-if="zhuangtai==2"  style="border-radius: 3%;">
				<view class="text-36 text-bold "style="border-bottom: solid #808080 1upx; text-align: center;">复查信息</view>
				<view class="border-bottom display justify-between align-center">
					<view class="text-36 padding-t30 padding-b30">复查人</view>
					<view class="text-32 font-gray1 padding-r30">{{danger_listMenu.review_user?danger_listMenu.review_user:'-'}}</view>
				</view>
				<view class="border-bottom display justify-between align-center">
					<view class="text-36 padding-t30 padding-b30 ">复查时间</view>
					<view class="text-32 font-gray1 padding-r30">{{danger_listMenu.review_time?danger_listMenu.review_time:'-'}}</view>
				</view>
				<view class="border-bottom  justify-between align-center">
					<view class="text-36 padding-t30 padding-b30">复查照片</view>
					<image  :src="phone2" class="addImage padding-r10"  v-if="phone2!=''" @tap="previewImage3(1)"></image>
					<image src="/static/add.png" class="addImage"v-else></image>
				</view>
				<view class="border-bottom margin-t30">
					<view class="text-36 padding-t30 padding-b30 border-top">复查内容描述</view>
					<view class="text-32 font-gray1 padding-r30 saytext padding-b30">{{danger_listMenu.review_remarks?danger_listMenu.review_remarks:'暂无巡检备注...'}}</view>
				</view>
			</view>
			</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				uid:'',
				token:'',
				xunjian_id:'',
				danger_listMenu:{},
				time:'',
				phone:'',
				phone1:'',
				phone2:'',
				zhuangtai:''
			}
		},
		onLoad:function(options){
			this.uid =uni.getStorageSync('user').uid;
			this.token =uni.getStorageSync('user').token;
			this.time=options.time
			this.zhuangtai=options.zhuangtai
			this.getXunjian(options.id)
		},
		methods: {
			getXunjian(e){
				var that=this
				uni.request({
					url:'https://aqmore.sxpz.vip/AppApi/SafetyInspection/getInspectionDetail?uid='+this.uid+'&token='+this.token+'&id='+e,
					method:'GET',
					header:{'content-type':'application/x-www-form-urlencoded'},
					success:function(res){
						console.log(res)
						that.danger_listMenu=res.data.datas
						console.log(that.danger_listMenu)
						that.phone=that.danger_listMenu.inspection_img
						that.phone1=that.danger_listMenu.rectify_img
						that.phone2=that.danger_listMenu.review_img
					}
				})
				
			},
			previewImage1: function(index) {
				var a={} 
				Array.from(a)
				console.log(a)
				 a[0] = this.phone
				 console.log(a)
				 var nameArray=[]
				 for(var i in a){
					 nameArray.push(a[i])
				 }
				 console.log(nameArray)
				uni.previewImage({
					current: index,
					urls: nameArray,
					success: function(res) {
						console.log(res)
					},
					fail: function(res) {
						console.log(res)
					}
				})
			},
			previewImage2: function(index) {
				var a={} 
				Array.from(a)
				console.log(a)
				 a[0] = this.phone1
				 console.log(a)
				 var nameArray=[]
				 for(var i in a){
					 nameArray.push(a[i])
				 }
				 console.log(nameArray)
				uni.previewImage({
					current: index,
					urls: nameArray,
					success: function(res) {
						console.log(res)
					},
					fail: function(res) {
						console.log(res)
					}
				})
			},
			previewImage3: function(index) {
				var a={} 
				Array.from(a)
				console.log(a)
				 a[0] = this.phone2
				 console.log(a)
				 var nameArray=[]
				 for(var i in a){
					 nameArray.push(a[i])
				 }
				 console.log(nameArray)
				uni.previewImage({
					current: index,
					urls: nameArray,
					success: function(res) {
						console.log(res)
					},
					fail: function(res) {
						console.log(res)
					}
				})
			},
		}
	}
</script>

<style>
	page{
			margin: 0;
			padding: 0;
			/* background-color: #0d98ed; */
		}
</style>
